package com.qf.business.cart.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.entity.po.Cart;
import com.qf.entity.vo.CartInfoVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 购物车表(Cart)表数据库访问层
 *
 * @author makejava
 * @since 2024-02-22 14:12:02
 */
public interface CartDao extends BaseMapper<Cart> {

    @Select("""
        select c.id, c.gid, g.title, g.image, g.price, c.number 
            from cart c join goods g on c.gid = g.id where c.uid = #{uid}
    """)
    List<CartInfoVo> queryMyCarts(Integer uid);


    List<CartInfoVo> queryCartsInfoByCids(@Param("cids") List<Integer> cids);
}

